﻿Public Class RseparacionVenta

    Public Shared Function SeleccionarXEstado(ByVal descEmpresa As String, ByVal DisplaySelect As Boolean) As List(Of EseparacionVenta)
        Dim proformas As List(Of EseparacionVenta) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                proformas = DseparacionVenta.SeleccionarXEstado(descEmpresa)
                If proformas Is Nothing Then proformas = New List(Of EseparacionVenta)
                'If DisplaySelect Then proformas.Insert(0, New EseparacionVenta("00", "-- SELECIONAR --"))
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return proformas
    End Function
    Public Shared Function AñadirSeparacion(ByVal descEmpresa As String, ByVal pseparacionVenta As EseparacionVenta, ByRef idSeparacionVenta As Int32) As Boolean
        Dim resultado As Boolean = False

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                resultado = DseparacionVenta.AñadirSepracion(descEmpresa, pseparacionVenta, idSeparacionVenta)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return resultado
    End Function
    Public Shared Function AñadirSeparacionTemporal(ByVal descEmpresa As String, ByVal pseparacionVenta As EseparacionVenta, ByRef idSeparacionVenta As Int32) As Boolean
        Dim resultado As Boolean = False

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                resultado = DseparacionVenta.AñadirSepracionTemporal(descEmpresa, pseparacionVenta, idSeparacionVenta)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return resultado
    End Function
    Public Shared Function AñadirVenta(ByVal descEmpresa As String, ByVal pseparacionVenta As EseparacionVenta, ByRef idSeparacionVenta As Int32) As Boolean
        Dim resultado As Boolean = False

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                resultado = DseparacionVenta.AñadirVenta(descEmpresa, pseparacionVenta, idSeparacionVenta)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return resultado
    End Function
    Public Shared Function ConvertirSepracionVenta(ByVal descEmpresa As String, ByRef idSeparacionVenta As Integer, ByVal pseparacionVenta As EseparacionVenta) As Boolean
        Dim resultado As Boolean = False

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                resultado = DseparacionVenta.ConvertirSepracionVenta(descEmpresa, idSeparacionVenta, pseparacionVenta)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return resultado
    End Function

    '********* ELIMINAR: CUANDO SE UPLOAD VENTAS **********
    Public Shared Function Editar(ByVal descEmpresa As String, ByVal pseparacionVenta As EseparacionVenta) As Boolean
        Dim resultado As Boolean = False

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                resultado = DseparacionVenta.Editar(descEmpresa, pseparacionVenta)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return resultado
    End Function

    Public Shared Function EditarSeparacion(ByVal descEmpresa As String, ByRef idSeparacionVenta As Integer, ByVal pseparacionVenta As EseparacionVenta) As Boolean
        Dim resultado As Boolean = False

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                resultado = DseparacionVenta.EditarSeparacion(descEmpresa, idSeparacionVenta, pseparacionVenta)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return resultado
    End Function
    Public Shared Function EditarSeparacionTemporal(ByVal descEmpresa As String, ByRef idSeparacionVenta As Integer, ByVal pseparacionVenta As EseparacionVenta) As Boolean
        Dim resultado As Boolean = False

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                resultado = DseparacionVenta.EditarSeparacionTemporal(descEmpresa, idSeparacionVenta, pseparacionVenta)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return resultado
    End Function
    Public Shared Function EditarVenta(ByVal descEmpresa As String, ByRef idSeparacionVenta As Integer, ByVal pseparacionVenta As EseparacionVenta) As Boolean
        Dim resultado As Boolean = False

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                resultado = DseparacionVenta.EditarVenta(descEmpresa, idSeparacionVenta, pseparacionVenta)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return resultado
    End Function
    Public Shared Function Eliminar(ByVal descEmpresa As String, ByVal pseparacionVenta As EseparacionVenta) As Boolean
        Dim resultado As Boolean = False

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                resultado = DseparacionVenta.Eliminar(descEmpresa, pseparacionVenta)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return resultado
    End Function
    Public Shared Function EliminarTemporal(ByVal descEmpresa As String, ByVal pseparacionVenta As EseparacionVenta) As Boolean
        Dim resultado As Boolean = False

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                resultado = DseparacionVenta.EliminarTemporal(descEmpresa, pseparacionVenta)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return resultado
    End Function
    Public Shared Function FiltrarSeparacion(ByVal descEmpresa As String, ByVal pSeparacionVenta As EseparacionVenta) As List(Of EseparacionVenta)
        Dim separacionVentas As List(Of EseparacionVenta) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                separacionVentas = DseparacionVenta.FiltrarSeparacion(descEmpresa, pSeparacionVenta)
                If separacionVentas Is Nothing Then separacionVentas = New List(Of EseparacionVenta)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return separacionVentas
    End Function
    Public Shared Function FiltrarSeparacionCtrl(ByVal descEmpresa As String, ByVal pSeparacionVenta As EseparacionVenta) As List(Of EseparacionVenta)
        Dim separacionVentas As List(Of EseparacionVenta) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                separacionVentas = DseparacionVenta.FiltrarSeparacionCtrl(descEmpresa, pSeparacionVenta)
                If separacionVentas Is Nothing Then separacionVentas = New List(Of EseparacionVenta)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return separacionVentas
    End Function
    Public Shared Function FiltrarSeparacionTemporal(ByVal descEmpresa As String, ByVal pSeparacionVenta As EseparacionVenta) As List(Of EseparacionVenta)
        Dim separacionVentas As List(Of EseparacionVenta) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                separacionVentas = DseparacionVenta.FiltrarSeparacionTemporal(descEmpresa, pSeparacionVenta)
                If separacionVentas Is Nothing Then separacionVentas = New List(Of EseparacionVenta)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return separacionVentas
    End Function
    Public Shared Function FiltrarSeparacionTemporalCtrl(ByVal descEmpresa As String, ByVal pSeparacionVenta As EseparacionVenta) As List(Of EseparacionVenta)
        Dim separacionVentas As List(Of EseparacionVenta) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                separacionVentas = DseparacionVenta.FiltrarSeparacionTemporalCtrl(descEmpresa, pSeparacionVenta)
                If separacionVentas Is Nothing Then separacionVentas = New List(Of EseparacionVenta)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return separacionVentas
    End Function
    Public Shared Function FiltrarVenta(ByVal descEmpresa As String, ByVal pSeparacionVenta As EseparacionVenta) As List(Of EseparacionVenta)
        Dim separacionVentas As List(Of EseparacionVenta) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                separacionVentas = DseparacionVenta.FiltrarVenta(descEmpresa, pSeparacionVenta)
                If separacionVentas Is Nothing Then separacionVentas = New List(Of EseparacionVenta)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return separacionVentas
    End Function
    Public Shared Function FiltrarVentaCtrl(ByVal descEmpresa As String, ByVal pSeparacionVenta As EseparacionVenta) As List(Of EseparacionVenta)
        Dim separacionVentas As List(Of EseparacionVenta) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                separacionVentas = DseparacionVenta.FiltrarVentaCtrl(descEmpresa, pSeparacionVenta)
                If separacionVentas Is Nothing Then separacionVentas = New List(Of EseparacionVenta)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return separacionVentas
    End Function

    '-------    MENU SEGUIMIENTO    --------'
    Public Shared Function SeleccionarSeguimiento(ByVal descEmpresa As String, ByVal DisplaySelect As Boolean, ByVal filtro As String, ByVal pSeparacionVenta As EseparacionVenta) As List(Of EseparacionVenta)
        Dim proformas As List(Of EseparacionVenta) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                proformas = DseparacionVenta.SeleccionarSeguimiento(descEmpresa, filtro, pSeparacionVenta)
                If proformas Is Nothing Then proformas = New List(Of EseparacionVenta)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return proformas
    End Function
    Public Shared Function SeleccionarSeguimientoEntrega(ByVal descEmpresa As String, ByVal pSeparacionVenta As EseparacionVenta) As EseparacionVenta
        Dim separacionVenta As EseparacionVenta = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                separacionVenta = DseparacionVenta.SeleccionarSeguimientoEntrega(descEmpresa, pSeparacionVenta)
                If separacionVenta Is Nothing Then separacionVenta = New EseparacionVenta
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return separacionVenta
    End Function
    Public Shared Function EditarSeguimiento(ByVal descEmpresa As String, ByVal pSeparacionVenta As EseparacionVenta) As Boolean
        Dim resultado As Boolean = False

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                resultado = DseparacionVenta.EditarSeguimiento(descEmpresa, pSeparacionVenta)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return resultado
    End Function

    '-------    MENU REPORTE    ------------'
    Public Shared Function ReporteSeparacion(ByVal descEmpresa As String, ByVal DisplaySelect As Boolean, ByVal pSeparacionVenta As EseparacionVenta) As List(Of EseparacionVenta)
        Dim proformas As List(Of EseparacionVenta) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                proformas = DseparacionVenta.ReporteSeparacion(descEmpresa, pSeparacionVenta)
                If proformas Is Nothing Then proformas = New List(Of EseparacionVenta)
                'If DisplaySelect Then proformas.Insert(0, New EseparacionVenta("00", "-- SELECIONAR --"))
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return proformas
    End Function
    Public Shared Function ReporteVenta(ByVal descEmpresa As String, ByVal DisplaySelect As Boolean, ByVal pSeparacionVenta As EseparacionVenta) As List(Of EseparacionVenta)
        Dim proformas As List(Of EseparacionVenta) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                proformas = DseparacionVenta.ReporteVenta(descEmpresa, pSeparacionVenta)
                If proformas Is Nothing Then proformas = New List(Of EseparacionVenta)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return proformas
    End Function

    '-------    MENU REPORTE TEMPORAL    ------------'
    Public Shared Function ReporteSeparacionTemporal(ByVal descEmpresa As String, ByVal DisplaySelect As Boolean, ByVal pSeparacionVenta As EseparacionVenta) As List(Of EseparacionVenta)
        Dim proformas As List(Of EseparacionVenta) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                proformas = DseparacionVenta.ReporteSeparacionTemporal(descEmpresa, pSeparacionVenta)
                If proformas Is Nothing Then proformas = New List(Of EseparacionVenta)
                'If DisplaySelect Then proformas.Insert(0, New EseparacionVenta("00", "-- SELECIONAR --"))
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return proformas
    End Function

    '-------    MENU REPORTE SEPARACION LEGAL     ------------'
    Public Shared Function ReporteSeparacionLegal(ByVal descEmpresa As String, ByVal DisplaySelect As Boolean, ByVal pSeparacionVenta As EseparacionVenta) As List(Of EseparacionVenta)
        Dim proformas As List(Of EseparacionVenta) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                proformas = DseparacionVenta.ReporteSeparacionLegal(descEmpresa, pSeparacionVenta)
                If proformas Is Nothing Then proformas = New List(Of EseparacionVenta)
                'If DisplaySelect Then proformas.Insert(0, New EseparacionVenta("00", "-- SELECIONAR --"))
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return proformas
    End Function

    '-------    MENU REPORTE SEPARACION COMERCIAL     ------------'
    Public Shared Function ReporteSeparacionComercial(ByVal descEmpresa As String, ByVal DisplaySelect As Boolean, ByVal pSeparacionVenta As EseparacionVenta) As List(Of EseparacionVenta)
        Dim proformas As List(Of EseparacionVenta) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                proformas = DseparacionVenta.ReporteSeparacionComercial(descEmpresa, pSeparacionVenta)
                If proformas Is Nothing Then proformas = New List(Of EseparacionVenta)
                'If DisplaySelect Then proformas.Insert(0, New EseparacionVenta("00", "-- SELECIONAR --"))
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return proformas
    End Function

    '-------    MENU REPORTE PENDIENTES DE PAGOS ------------'
    Public Shared Function ReportePendientesPagos(ByVal descEmpresa As String, ByVal DisplaySelect As Boolean, ByVal pSeparacionVenta As EseparacionVenta) As List(Of EseparacionVenta)
        Dim proformas As List(Of EseparacionVenta) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                proformas = DseparacionVenta.ReportePendientesPagos(descEmpresa, pSeparacionVenta)
                If proformas Is Nothing Then proformas = New List(Of EseparacionVenta)
                'If DisplaySelect Then proformas.Insert(0, New EseparacionVenta("00", "-- SELECIONAR --"))
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return proformas
    End Function
    Public Shared Function ReportePendientesPagosBest(ByVal descEmpresa As String, ByVal DisplaySelect As Boolean, ByVal pSeparacionVenta As EseparacionVenta) As List(Of EseparacionVenta)
        Dim proformas As List(Of EseparacionVenta) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                proformas = DseparacionVenta.ReportePendientesPagosBest(descEmpresa, pSeparacionVenta)
                If proformas Is Nothing Then proformas = New List(Of EseparacionVenta)
                'If DisplaySelect Then proformas.Insert(0, New EseparacionVenta("00", "-- SELECIONAR --"))
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return proformas
    End Function

    '-------    MENU REPORTE INGRESOS POR DEPOSITOS ---------'
    Public Shared Function ReporteIngresosDeposito(ByVal descEmpresa As String, ByVal DisplaySelect As Boolean, ByVal pSeparacionVenta As EseparacionVenta) As List(Of EseparacionVenta)
        Dim proformas As List(Of EseparacionVenta) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                proformas = DseparacionVenta.ReporteIngresosDeposito(descEmpresa, pSeparacionVenta)
                If proformas Is Nothing Then proformas = New List(Of EseparacionVenta)
                'If DisplaySelect Then proformas.Insert(0, New EseparacionVenta("00", "-- SELECIONAR --"))
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return proformas
    End Function

    '-------   MENU ATENCION CLIENTE  ------'
    Public Shared Function SeleccionarXCliente(ByVal descEmpresa As String, ByVal pSeparacionVenta As EseparacionVenta) As List(Of EseparacionVenta)
        Dim separacionVentas As List(Of EseparacionVenta) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                separacionVentas = DseparacionVenta.SeleccionarXCliente(descEmpresa, pSeparacionVenta)
                If separacionVentas Is Nothing Then separacionVentas = New List(Of EseparacionVenta)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return separacionVentas
    End Function

    '-------   MENU AHORRO PREVIO  ------'
    Public Shared Function SeleccionarXAhorroPrevio(ByVal descEmpresa As String, ByVal pSeparacionVenta As EseparacionVenta, ByVal filtro As String) As List(Of EseparacionVenta)
        Dim ahorrosPrevios As List(Of EseparacionVenta) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                ahorrosPrevios = DseparacionVenta.SeleccionarAhorroPrevio(descEmpresa, pSeparacionVenta, filtro)
                If ahorrosPrevios Is Nothing Then ahorrosPrevios = New List(Of EseparacionVenta)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return ahorrosPrevios
    End Function

    '-------   MENU COBRANZA  ------------'
    Public Shared Function SeleccionarXCobranza(ByVal descEmpresa As String, ByVal pSeparacionVenta As EseparacionVenta) As List(Of EseparacionVenta)
        Dim cobranzas As List(Of EseparacionVenta) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                cobranzas = DseparacionVenta.SeleccionarXCobranza(descEmpresa, pSeparacionVenta)
                If cobranzas Is Nothing Then cobranzas = New List(Of EseparacionVenta)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return cobranzas
    End Function
    Public Shared Function EditarSeparacionPagoFileScan(ByVal descEmpresa As String, ByVal pSeparacionVenta As EseparacionVenta) As Boolean
        Dim resultado As Boolean = False

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                resultado = DseparacionVenta.EditarSeparacionPagoFileScan(descEmpresa, pSeparacionVenta)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return resultado
    End Function
    '-------------------------------------'

End Class
